package homework.polymorphic;

import homework.polymorphic.Graphic;

public class Circle extends Graphic {
    private double radius;

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    @Override
    public double area() {
        return Math.PI*radius*radius;
    }

    @Override
    public double perimeter() {
        return 2*Math.PI*radius;
    }

    @Override
    public String getInfo() {
        return "圆的半径为"+radius+",面积为"+area()+",周长为"+perimeter();
    }
}
